package deprecated;
import MyQuery;
import User;

import java.util.ArrayList;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		MyQuery query = new MyQuery();
		
		boolean[] patient = {true, false, false, false};
		boolean[] invalid = {false, true, false, true, true, false};
		
		User userA = new User("billy", "aaa", patient, 34572);
		User userB = new User("billy", "bbb", patient, 829);
		User userC = new User(null, "ccc", invalid, 5820);
		
		/*
		 * Query.add(userA, userB, userC);
		 */
		try{
			query.addUser(userA);
			query.addUser(userB);
			query.addUser(userC);
		}catch(Exception e){
			// TODO exception handling.
		}
		
		/*
		 * Search
		 */
		ArrayList<User> users = new ArrayList<User>();
		try{
			users = query.searchUserByName("billy");
		}catch(Exception e){
			
		}
		
		/*
		 * Load a user
		 */
		User user1 = null;
		if(users.size() >= 1){
			user1 = users.get(0);
		}
		
		
		/*
		 * Change user data
		 */
		if(user1 != null){
			user1.setPassword("hey");
		}
		
		/*
		 * Update user
		 */
		try{
			query.updateUser(user1, user1.getSSN());
		}catch(Exception e){
			
		}
		
		/*
		 * Delete User
		 */
		try{
			query.deleteUser(34572);
		}catch(Exception e){
			// TODO stuff
		}
		
		
		
		
		/* *******************************************************************************
		 * TREATMENT RECORD
		 */
		
		

	}

}
